<?php

namespace app\index\validate;

use app\index\service\OptService;
use think\Validate;

class BidSum extends Validate
{

    protected $rule = [
        'id' => 'require|number',
        'bidid' => 'require'
    ];

    protected $message = [
        'id' => '网络错误',
        'bidid' => '请选择项目',
    ];

    protected $scene = [
        'add' => ['bidid'],
        'edit' => ['id','bidid'],
    ];

    public function check_bid_evaluation($value){
        if(!(new OptService())->check_option_exists('bid_bid_evaluation',$value)){
            return '请选择评标方式';
        }
        return true;
    }


}















